package dao.jpa;

import java.util.List;

import vo.Paper;
import vo.Sentence;
import dao.SentenceDAO;

public class SentenceDAOJpaImpl extends GenericDaoJpaImpl<Sentence, Long> implements SentenceDAO {

	public SentenceDAOJpaImpl() {
		super(Sentence.class);
	}

	public List<Sentence> findByPaperId(long paperId) {
		return super.executeFinder("Sentence.findByPaperId", paperId);
	}

	public List<Sentence> findAll(int start, int pageSize) {
		return super.executeFinderPage("Sentence.findAll", start, pageSize);
	}

	// 分页
	public List<Sentence> findAll() {
		return super.executeFinder("Sentence.findAll");
	}

	public long findTotalCount() {
		return super.executeFinderCount("Sentence.findTotalCount");
	}

	// 关键字分页
	public List<Sentence> findByKeyword(int start, int pageSize,String keyword) {
		return super.executeFinder("Sentence.findByKeyword",keyword);
	}

	public long findTotalCountByKeyword(String keyword) {
		return super.executeFinderCount("Sentence.findTotalCountByKeyword",keyword);
	}

	public List<Sentence> findByPaperId(int start, int pageSize, long paperId) {
		return super.executeFinderPage("Sentence.findByPaperId", start, pageSize, paperId);
	}

	public long findTotalCountByPaperId(long paperId) {
		return super.executeFinderCount("Sentence.findTotalCountByPaperId", paperId);
	}

	//类型分页
	public List<Sentence> findByType(int start, int pageSize, long type) {
		return super.executeFinderPage("Sentence.findByType", start, pageSize, type);
	}

	public long findTotalCountByType(long type) {
		return super.executeFinderCount("Sentence.findTotalCountByType", type);
	}
	//类型，关键字分页
	public List<Sentence> findByTypeKeyword(int start, int pageSize, long type,String keyword) {
		return super.executeFinderPage("Sentence.findByTypeKeyword", start, pageSize, type,keyword);
	}

	public long findTotalCountByTypeKeyword(long type,String keyword) {
		return super.executeFinderCount("Sentence.findTotalCountByTypeKeyword", type,keyword);
	}

}
